﻿@model AP.Framework.Infrastructure.Entities.cms_Article
<script type="text/javascript">
    $(function () {
        $('#Content').xheditor({ upLinkUrl: "/Admin/Article/Upload",
            upLinkExt: "zip,rar,txt",
            upImgUrl: "/Admin/Article/Upload",
            upImgExt: "jpg,jpeg,gif,png"
        });
        $('#file_upload').uploadify({
            'swf': '@Url.Content("~/Areas/Admin/Content/uploadify/uploadify.swf")',
            'buttonText': '添加图片...',
            'cancelImg': '@Url.Content("~/Areas/Admin/Content/uploadify/uploadify-cancel.png")',
            'uploader': '/Admin/Article/Upload',
            'auto': true,
            'onUploadSuccess': function (file, data, response) {
                eval("data=" + data);
                $("#ImageUrl").val(data.msg);
                $("#articleImage").attr("src", data.msg);
            }
        });
        $("#articleImage").attr("src", $("#ImageUrl").val());
    });      
</script>
@Html.ValidationSummary(true)
<br />
<table id="tradeRecordsIndex" class="ui-table">
    <tbody>
        <tr>
            <td class="info">
                频道
            </td>
            <td>
                @Html.DropDownListFor(model => model.ChannelID, (IEnumerable<SelectListItem>)ViewBag.channelList)
                @Html.ValidationMessageFor(model => model.ChannelID)
            </td>
        </tr>
        <tr>
            <td class="info">
                分类
            </td>
            <td>
                @Html.DropDownListFor(model => model.CategoryId, (IEnumerable<SelectListItem>)ViewBag.articleCategoryList)
                @Html.ValidationMessageFor(model => model.CategoryId)
            </td>
        </tr>
        <tr>
            <td class="info">
                显示方式
            </td>
            <td>
                @Html.RadioButtonFor(p => p.DisplayStyle, 1) 文本 @Html.RadioButtonFor(p => p.DisplayStyle, 2)幻灯片
                @Html.ValidationMessageFor(model => model.DisplayStyle)
            </td>
        </tr>
        <tr>
            <td class="info">
                标题
            </td>
            <td>
                @Html.TextBoxFor(model => model.Title, new { @placeholder = "标题", style = "width:98%;" })
                @Html.ValidationMessageFor(model => model.Title)
            </td>
        </tr>
        <tr>
            <td class="info">
                作者
            </td>
            <td>
                @Html.TextBoxFor(model => model.Author, new { @placeholder = "作者", style = "width:98%;" })
                @Html.ValidationMessageFor(model => model.Author)
            </td>
        </tr>
        <tr>
            <td class="info">
                摘要
            </td>
            <td>
                @Html.TextAreaFor(model => model.ZhaiYao, new { @placeholder = "摘要", style = "width:98%" })
                @Html.ValidationMessageFor(model => model.ZhaiYao)
            </td>
        </tr>
        <tr>
            <td class="info">
                正文
            </td>
            <td>
                @Html.TextAreaFor(model => model.Content, new { @placeholder = "描述", style = "width:100%; height:150px;" })
                @Html.ValidationMessageFor(model => model.Content)
            </td>
        </tr>
        <tr>
            <td class="info">
                图片
            </td>
            <td>
                @Html.TextBoxFor(model => model.ImageUrl, new { @placeholder = "点击上传图片按钮......" })
                &nbsp;&nbsp;(当选择显示方式为幻灯片时,必须上传一张<span style="color: Red">940*374</span>象素的图片)
                <input type="file" name="file_upload" id="file_upload" />
                <img id="articleImage" alt="图片缩放显示" src="" style=" width:100px; height:100px;" />
                @Html.ValidationMessageFor(model => model.ImageUrl)
            </td>
        </tr>
        <tr>
            <td class="info">
                排序号
            </td>
            <td>
                @Html.TextBoxFor(model => model.Sequence, new { @placeholder = "排序号" })
                @Html.ValidationMessageFor(model => model.Sequence)
            </td>
        </tr>
        <tr>
            <td class="info">
                是否隐藏/锁定
            </td>
            <td>
                @Html.CheckBoxFor(model => model.IsDisable)
                @Html.ValidationMessageFor(model => model.IsDisable)
            </td>
        </tr>
        <tr>
            <td class="info">
            </td>
            <td>
                <div class="submit-time ui-button ui-button-sorange">
                    <button type="submit" class="ui-button-text">
                        保 存</button>
                </div>
            </td>
        </tr>
    </tbody>
</table>
